import java.io.File
import scala.io.Source
// 文件读写演示
//
//val writer = new java.io.PrintWriter(new File("D:\\project\\wy-badou-big-data\\wang-yi-yun-foundation\\src\\test\\java\\笔记.txt"))
//writer.write("Line 1 content in test.txt \n")
//writer.write("Line 2 content in test.txt \n")
//writer.close()

// 读文本文件
val src1 = Source.fromFile("D:\\project\\wy-badou-big-data\\wang-yi-yun-foundation\\src\\test\\java\\笔记.txt","utf-8")
for (l <- src1.getLines()) {
  println(l)
}
src1.mkString
src1.close()

// 访问目录
println("#"*10)
import java.nio.file._
val dir = "D:\\project\\wy-badou-big-data"
val path = Paths.get(dir)
println(path.toString)
println(path.getParent.toString)